package com.freewater.javabase.demo.designpattern.command2.macro.command;

/**
 * Created by FreeWater on 2017/4/9.
 */
public class MacroCommand implements Command {

	private Command[] commands;

	public MacroCommand(Command[] commands){
		this.commands = commands;
	}

	@Override
	public void execute() {
		for(Command command : commands){
			command.execute();
		}
	}

	@Override
	public void undo() {
		for(Command command : commands){
			command.undo();
		}
	}
}
